package com.example.template;

public abstract class Beverage {

    // 模版骨架，不允许子类修改
    public final void prepareBeveraage() {
        boliWater();
        brew();
        pourInCup();
        addCondiments();
    }

    // 固定步骤
    private void boliWater() {
        System.out.println("烧水");
    }

    // 固定步骤
    private void pourInCup() {
        System.out.println("倒入杯子");
    }

    protected abstract void brew();

    protected abstract void addCondiments();
}
